﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DE.Interfaces
{
    /// <summary>
    /// Represents the DE Agent services
    /// </summary>
    public interface IDEAgent
    {
        /// <summary>
        /// Holds the data structure of the entity
        /// </summary>
        IBaseEntityData Data { get; set; }

        /// <summary>
        /// call for creating new DE to the DB
        /// </summary>
        /// <param name="data">the DE data</param>
        int Create(IBaseEntityData data);

        /// <summary>
        /// Call for updatings the data of a DE that exists in the DB
        /// </summary>
        void Update(IBaseEntityData data);

        /// <summary>
        /// Call for delete DE from DB
        /// </summary>
        void Delete(int id);

        /// <summary>
        /// Fetch the data of the requested DE from DB
        /// The Fetched data will be assigned to the Data member.
        /// </summary>
        /// <param name="id">The DE id to fetch data to</param>
        void Fetch(int userid, object additions);

        /// <summary>
        /// Call for validation of data of a given DE
        /// </summary>
        /// <returns>True if the data is legal, False if not</returns>
        int Validate(string username, string password, object additions);
    }
}
